#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    n=0;
}

MainWindow::~MainWindow()
{
    delete ui;
}

//控制子窗口
void MainWindow::on_pushButton_2_clicked()
{
    n++;
    if(n%2==1)
        ui->widget->hide();
    else
        ui->widget->show();
}
